//
//  UIButton+Category.m
//  BabyPlans
//
//  Created by apple on 2016/11/7.
//  Copyright © 2016年 apple. All rights reserved.
//

#import "UIButton+Category.h"

@implementation UIButton (Category)
- (void)setTitleColor:(UIColor *)color selectColor:(UIColor *)selectColor{

    [self setTitleColor:color forState:UIControlStateNormal];
    [self setTitleColor:selectColor forState:UIControlStateSelected];
}
- (void)setTitle:(NSString *)title selectTitle:(NSString *)selectTitle{

    [self setTitle:title forState:UIControlStateNormal];
    [self setTitle:selectTitle forState:UIControlStateSelected];
}
- (void)setImage:(UIImage *)image selectImg:(UIImage *)selectImg{

    [self setImage:image forState:UIControlStateNormal];
    [self setImage:selectImg forState:UIControlStateSelected];
}
- (void)tranpositionImageAnTitleLable{

    UIImage * image = self.currentImage;
    
    if (!image || !self.currentTitle) {
        return;
    }
    
    CGSize textLblSize = textSizeFont(self.currentTitle, self.titleLabel.font, MAXFLOAT, MAXFLOAT);
    [self setTitleEdgeInsets:UIEdgeInsetsMake(0, -image.size.width, 0, image.size.width)];
    [self setImageEdgeInsets:UIEdgeInsetsMake(0, textLblSize.width, 0, -textLblSize.width)];
}
@end
